﻿<%@ Page Language="C#" MasterPageFile="~/admin/TeampAdmin.Master" AutoEventWireup="true" CodeBehind="QLSanPham.aspx.cs" Inherits="CungUngXayDung.admin.QLSanPham" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PageTittle" Runat="Server">
    QUẢN LÝ SẢN PHẨM
<hr>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
        
        <br/>
        <table align="left" width="25px">
        <tr> <td>
        <asp:Button id = "btnThem" runat = "server"  Text = "Thêm" 
            onclick="btnThem_Click" Width="105px" />
        </td> </tr>
        </table>
        <br>
        <br />                
        <center>        
            <asp:GridView ID="GridView1" runat="server" 
            AutoGenerateColumns="False" EnableModelValidation="True" AllowPaging="True" 
                onpageindexchanging="GridView1_PageIndexChanging" PageSize="6" 
                onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
                HorizontalAlign="Center" BorderColor="Black" CaptionAlign="Bottom">
        <Columns>
            <asp:BoundField DataField="MaSanPham" HeaderText="Mã sản phẩm" />
            <asp:BoundField DataField="TenSanPham" HeaderText="Tên sản phẩm" />
            <asp:BoundField DataField="TenNhaSanXuat" HeaderText="Tên nhà sản xuất" />
            <asp:BoundField DataField="DonViTinh" HeaderText="Đơn vị tính" />
            <asp:BoundField DataField="GiaBan" HeaderText="Giá bán" />
            <asp:BoundField DataField="MoTa" HeaderText="Mô tả" />
            <asp:BoundField DataField="SoLuongTon" HeaderText="Số lượng tồn" />
            <asp:BoundField DataField="HinhAnh" HeaderText="Hình ảnh" />
            <asp:BoundField DataField="MaLoaiSanPham" HeaderText="Mã loại sản phẩm" />
             <asp:BoundField DataField="AnHien" HeaderText="Ẩn hay hiện" />
            
            <asp:TemplateField HeaderText="Hình ảnh">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" Height="110px" Width="167px" ImageUrl='<%# Bind("HinhAnh", "~/images/SanPham/{0}") %>'/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField EditText="Sửa" ShowEditButton="True" />
            <asp:CommandField CancelText="Thoát" DeleteText="Xóa" ShowDeleteButton="True" />
        </Columns>
        </asp:GridView></center>
    </div>
</asp:Content>
